package com.app.base.fragment;


import com.app.BuildConfig;
import com.caszx.chargingpile.R;
import com.nispok.snackbar.Snackbar;
import com.nispok.snackbar.SnackbarManager;
import com.rey.material.app.Dialog;
import com.rey.material.app.DialogFragment;
import com.rey.material.app.SimpleDialog;
import com.umeng.analytics.MobclickAgent;


import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Toast;

public abstract class BaseFragment extends Fragment {

	@Override
	public void onViewCreated(View view, Bundle savedInstanceState) {
		super.onViewCreated(view, savedInstanceState);
	}

	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container,
			Bundle savedInstanceState) {
		init();
		View view = initView();
		return view;
	}
	@Override
	public void onResume() {
		super.onResume();
		if(!BuildConfig.DUBUG)
		MobclickAgent.onPageStart("MainScreen"); // 统计页面
	}

	public void onPause() {
		super.onPause();
		if(!BuildConfig.DUBUG)
		MobclickAgent.onPageEnd("MainScreen");
	}
	/**
	 * 初始化<b>（不包含View的初始化）
	 */
	protected  void init(){};

	/**
	 * 
	 * 初始化View，作为Fragment的根布局
	 * 
	 * @return
	 */
	protected abstract View initView();


}
